package com.automannn.seataSamples.api.response;

/**
 * @author automannn
 * @Date 2022/3/24
 * @Description 业务异常
 */
public final class BusinessException extends RuntimeException{

    private ResponseStatusEnum responseStatusEnum;

    public BusinessException(String message,Throwable cause){
        super(message,cause);
    }

    public BusinessException(ResponseStatusEnum responseStatusEnum){
        super(responseStatusEnum.getMessage());
        this.responseStatusEnum = responseStatusEnum;
    }

    public BusinessException(ResponseStatusEnum responseStatusEnum,Throwable cause){
        super(responseStatusEnum.getMessage(),cause);
        this.responseStatusEnum = responseStatusEnum;
    }

    public ResponseStatusEnum getResponseStatusEnum() {
        return responseStatusEnum;
    }

    public void setResponseStatusEnum(ResponseStatusEnum responseStatusEnum) {
        this.responseStatusEnum = responseStatusEnum;
    }
}
